cap prog drop txlsdlg
prog define  txlsdlg
	
	syntax, [file(string)     ///
			 dirc(string)  todir(string) XLS]


if (`"`file'"'!=""&`"`dirc'"'!=""){

	di _n "note: dirc() is ignored as file() is specified"

}
	

if (`"`file'"'==""){
	if(`"`dirc'"'==""){
		di as error "either file() or dirc() should be specified"
		error 198
	}
	else{

		local file `dirc'
	}
}

if "`xls'"!=""{
	local axls ,xls
}

	// get the install file names of anything
	di _n(1) "{title:Executing the txls command}" _n
	if `"`todir'"'==""{
        di as txt `"txls `file' `axls' "'   _n 
    }
    else{
        di as txt `"txls `file', todir(`todir') `xls'"'   _n 
    }

	// call the txls function  
	txls `"`file'"',todir(`"`todir'"') `xls'    
	
end
